// Source file:
// G:\\5o_ano\\PCS2040\\desenvolvimento\\rose\\Servidor\\Roteamento\\Localizacao.java

package comum;

import java.io.Serializable;

public class Localizacao implements Serializable {
    private int x;
    private int y;
    private int andar;
    
    private String direction;

    public String getDirection() {
		return direction;
	}

	public void setDirection(String direction) {
		this.direction = direction;
	}

	/**
     * @roseuid 426D7C51032C
     */
    public Localizacao(int _x, int _y, int _andar) {
        x = _x;
        y = _y;
        andar = _andar;
    }

    /**
     * @roseuid 4259AC3E01E4
     */
    public void setLocalizacao(int _x, int _y, int _andar) {
        x = _x;
        y = _y;
        andar = _andar;
    }

    /**
     * @roseuid 4259AC470167
     */
    public int getX() {
        return x;
    }

    /**
     * @roseuid 4259AC4F0119
     */
    public int getY() {
        return y;
    }

    /**
     * @roseuid 4259AC530222
     */
    public int getAndar() {
        return andar;
    }
    
    public double distancia(Localizacao destino) {
    	return Math.sqrt(Math.pow((this.getX() - destino.getX()), 2) + 
		                 Math.pow((this.getY() - destino.getY()), 2) +
				         Math.pow((this.getAndar() - destino.getAndar()), 2));
    }
    
    public String toString() {
        return "(" + x + ", " + y + ", " + andar + ")";
    }
}